package com.android.volley.socket;

import android.util.Log;

/**
 * Created by yinzhiqun on 2015/8/31.
 * 多个接口请求
 */
public abstract class MultiRequest {
    private boolean hasNext;
    private byte[] nextRequestData;

    public boolean hasNext() {
        return hasNext;
    }

    public byte[] next() {
        return nextRequestData;
    }

    protected void newRequest(String str){
        Log.i("kids",str);
        nextRequestData = str.getBytes();
        hasNext = true;
    }

    public void onResponse(byte[] bytes) {
        hasNext = false;
        String s = new String(bytes);
        Log.i("kid",s);
        onResponse(s);
    }

    protected abstract void onResponse(String str);
}
